<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<%@page import="cn.ainit.sys.menu.SessionCont"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/ainit.css" type="text/css"></link>
		<link rel="stylesheet" href="../printCss/print.css" type="text/css"></link>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/sysPrint/printCss/print.css" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.2.2.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.json-2.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ainit-1.0.0.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/jquery.ainit-1.1.0.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/model.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/perlize.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/save.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/initPage.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/sysReport/report.js"></script>

		<script type="text/javascript">
			$(function() {
				$("#dotted :last ").remove()
			});
		</script>
		        <script type="text/javascript">
        window.onload=function name(){
          window.print();
          window.close();
    }
     </script> 
		<style type="text/css">
		table{border-collapse:collapse;
			}
		</style>
	</head>
	<body>
<table cellpadding="0px" cellspacing="0px" width="730px" border="0">
                        <tr>
                            <th colspan="40" style="font-size: 22px">${Company.COM_PRINTNAME}对账结算单</th>
                        </tr>
                        <tr>
                            <td colspan="1" ><strong>客户编码:</strong></td>
                            
                            <td colspan="6" ><strong>${data.CLIENTS_NO}</strong></td>
                		</tr>
                        <tr>
                            <td ><strong>客户名称:</strong></td>
                            <td colspan="2" >${data.CLIENTS_NAME}</td>
                            <td align="center"><strong>打印日期:</strong></td>
                            <td >
                                <jsp:useBean id="now" class="java.util.Date" scope="page" />
                                <fmt:formatDate value="${now}" pattern="yyyy-MM-dd" />
                            </td>
                            <td width="80px" align="center"><strong>结算日期:</strong></td>
                            <td >${data.JS_MONTH}</td>
                        </tr>
                        <tr>
                            <td colspan="7"><hr width=730px /></td>
                        </tr>
                        <tr>
                            <td colspan="7"> 账期内：</td></tr>
                        <tr height="12px"> 
                            <td width="80" align="center"><strong>序号</strong></td> 
                            <td width="90" ><strong>出入日期</strong></td>
                            <td width="140" ><strong >业务单号</strong></td>
                            <td width="90" align="center"><strong>码洋</strong></td>
                            <td width="90" ><strong>折扣</strong> </td>
                            <td width="80" ><strong>实洋</strong></td>
                            <td colspan="2" ><strong>备注</strong></td>
                        </tr>
                        <tr height="12px">
                            <td colspan="7"><hr width=730px align="left" /></td>
                        </tr>
                        <c:forEach items="${dataList}" var="temp">
                            <c:if test="${temp.D_TYPE=='ZN'}">
                                <tr >
                                    <td width="80" align="center">${temp.ROWNUM}</td>
                                    <td width="90" >${temp.YW_INPUT_DATE} </td>
                                    <td width="140" >${temp.YW_CODE}</td>
                                    <td width="90" align="center">${temp.TOTAL_MONEY}</td>
                                    <td width="60" >${temp.C_DISCOUNT}</td>
                                    <td width="80" >${temp.REAL_MONEY}</td>
                                    <td width="200" >${temp.YW_MEMO}</td>
                                </tr>
                                <tr id="dotted">
                                    <td colspan="7">
                                        <hr width=730px align="left" style="border: 1px dotted;" />
                                    </td>
                                </tr>
                            </c:if>
                        </c:forEach>
                        <tr>
                            <td colspan="7"><hr width=730px align="left" /></td>
                        </tr>
                        <tr>
                            <td colspan="7"><b>本期应收款：${data.THIS_YS_MONEY}</b></td>
                        </tr>
                        <tr>
                            <td colspan="7">账期外：</td>
                        </tr>
                        <tr>
                            <td colspan="7" width=730px align="left" ></td>
                        </tr>
                        <tr >
                            <td width="60" align="center"><strong>序号</strong></td>
                            <td width="80" ><strong>出入日期</strong></td>
                            <td width="140" ><strong>业务单号</strong></td>
                            <td width="90" align="center"><strong>码洋</strong></td>
                            <td width="60" ><strong>折扣</strong></td>
                            <td width="80" ><strong>实洋</strong></td>
                            <td width="200" ><strong>备注</strong></td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <hr width=730px align="left" />
                            </td>
                        </tr>
                        <c:forEach items="${dataList}" var="temp">
                            <c:if test="${temp.D_TYPE=='ZW'}">
                                <tr>
                                    <td align="center">${temp.ROWNUM}</td>
                                    <td >${temp.YW_INPUT_DATE}</td>
                                    <td >${temp.YW_CODE}</td>
                                    <td align="center">${temp.TOTAL_MONEY} </td>
                                    <td >${temp.C_DISCOUNT}</td>
                                    <td >${temp.REAL_MONEY}</td>
                                    <td >${temp.YW_MEMO}</td>
                                </tr>
                                <tr id="dotted">
                                    <td colspan="7">
                                        <hr width=730px style="border: 1px dotted;" />
                                    </td>
                                </tr>
                            </c:if>
                        </c:forEach>
                        <tr>
                            <td colspan="7">
                                <hr width=730px align="left" />
                            </td>
                        </tr>
                        <tr height="20">
                        	<th colspan="7" align="left">业务联系方式</th>
                        </tr>
                        <tr height="20">
                            <td><strong >电话:</strong></td>
                            <td >${data.O_TELPHONE}</td>
                            <td><strong>联系人:</strong></td>
                            <td colspan="4">
                            ${data.o_name}
                                <c:if test="${not empty data.O_TELPHONE2}">(分机:${data.o_telphone2 })</c:if>
                            </td>
                        </tr>
                        <tr height="25" style="margin-bottom:30px;">
                            <td><strong>传真:</strong></td>
                            <td >${data.C_FAX}</td>
                            <td><strong>对　账:</strong></td>
                            <td colspan="4">
                                ${data.O_NAME}
                                <c:if test="${not empty data.O_TELPHONE2}">(分机:${data.O_TELPHONE2})</c:if>  
                            </td>
                        </tr>
                        <tr height="20"></tr>
                        <tr height="20">
                        	<th colspan="7" align="left">财务资料</th>
                        </tr>
                        <tr height="25">
                            <td><strong>户名:</strong></td>
                            <td style="padding-left: 0px" colspan="6">${Company.ACCOUNT_NAME1}</td>
                        </tr>
                        <tr height="25">
                            <td ><strong>开户行:</strong></td>
                            <td widht="230px" colspan="2">${Company.ACCOUNT_BANK1}</td>
                            <td ><strong>账号:</strong></td>
                            <td align="left" colspan="3">${Company.ACCOUNT_NO1}</td>
                        </tr >
                        <tr height="20"></tr>
                        <tr height="25">
                        	<th colspan="7" align="left">退货地址</th>
                        </tr>
						<tr height="25">
                            <td ><strong>北京市:</strong></td>
                            <td  colspan="2">${Company.STOCK_ADDRESS}</td>
                            <td><strong>电话:</strong></td>
                            <td colspan="3">${Company.STOCK_TEL}</td>
                        <tr>
	                            <td height="25"><strong >邮编:</strong></td>
	                            <td colspan="2">${Company.STOCK_ZIP}</td>
                        </tr>
                        </tr>
                        <tr height="20"></tr>
                        <tr height="20">
                        	<th colspan="7" align="left">对账信息（请盖章并回传）</th>
                        </tr>
	
                        <tr height="20">
                            <td colspan="2"><strong>上次开票未回款余额:</strong></td>
                            <td >${data.LAST_MONEY }</td>
                            <td><strong>预收余额:</strong></td>
                            <td colspan="3">${data.pre_money }</td>
                        </tr>
                        <tr height="20">
                            <td colspan="2"><strong>本期金额:</strong></td>
                            <td >${data.THIS_YS_MONEY }</td>
                            <td ><strong>收款差异:</strong></td>
                            <td colspan="3">${data.chayi_money }</td>
                        </tr>
                        <tr height="20">
                            <td colspan="2"><strong>应收款:</strong></td>
                            <td>${data.THIS_MONEY }</td>
                            <td ><strong >总欠款:</strong></td>
                            <td colspan="3">${data.THIS_ZYS }</td>
                        </tr>
		
        				<tr height="40">
                            <td colspan="13" align="right">
                                <span style="font-size: 11px ;color: #9BA4AF">技术支持:</span>
                                <span style="font-size: 12px ;color: #9BA4AF">上海爱你特科技  www.ainit.cn</span>			
                            </td>
                        </tr>
                 </table>
    </body>
</html>